// 数据对象接口

import { PlainObject } from './base';

// 公共数据模型都会有id,因此作者应该是打算把他提出来
export interface RecordDTO extends PlainObject {
  id: number;
}

export interface CategoryCamelCaseDTO extends RecordDTO {
  categoryName: string;
}
export interface TagCamelCaseDTO extends RecordDTO {
  tagName: string;
}

export interface ArticleDTO extends RecordDTO {
  article_name: string;
  article_text: string;
  author: string;
  poster: string;
  summary: string;
  read_num: number;
  create_time: string;
  private: 0 | 1;
  tags: TagCamelCaseDTO[];
  categories: CategoryCamelCaseDTO[];
}

export interface TagDTO extends RecordDTO {
  tag_name: string;
}

export interface CategoryDTO extends RecordDTO {
  category_name: string;
  // category_count: number;
}

export interface CommentUserInfo extends PlainObject {
  nick_name: string;
  email: string;
  site_url: string;
}

export interface CommentDTO extends RecordDTO {
  site_url: string;
  nick_name: string;
  avatar?: string;
  create_time: string;
  content: string;
  article_id?: number;
  article_name: string;
  email: string;
  jump_url: string;
  replies: ReplyDTO[];
}

export interface ReplyDTO extends RecordDTO {
  site_url: string;
  nick_name: string;
  avatar?: string;
  create_time: string;
  content: string;
  article_id?: number;
  article_name: string;
  email: string;
  jump_url: string;
  reply_name: string;
}

export interface MsgListDTO {
  time: string;
  user: string;
  content: string;
  type: string;
  customClass: string;
  pic: boolean;
}

export interface prevOrnextDTO extends RecordDTO {
  article_name: string;
}

export interface UserDTO extends RecordDTO {
  role_id: number;
  role_name: string;
  user_name: string;
  avatar: string;
  last_login_time: string;
}
